<template>
  <div class="user-info">
    <div class="user-portrait">
        <img src="@/assets/images/TouXiangX.png" />
        <div>
            <span style="color: #E03A60">{{name}}</span><span>,欢迎回来！</span>
        </div>
    </div>
    <div class="info">
      <span>用户编号：<b>{{user_no}}</b></span><br>
      <span>用户等级：{{levelName}}</span><br>
      <span>电子邮箱：{{email}}</span><br>
      <span>账户余额：<b>{{money}}</b>日元<a href="MoneyRuAddZfb.aspx">在线支付</a></span>
  </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      name: '',
      user_no: '',
      level: 0,
      email: '',
      phone: '',
      money: ''
    }
  },
  computed: {
    levelName: function () {
      switch (this.level) {
        case 1:
          return '高级会员'
        default:
          return '未知'
      }
    }
  },
  created: function () {
    let self = this
    this.$axios.get('/api/User/GetInfo').then(function (data) {
      self.name = data[0].name
      self.user_no = data[0].user_no
      self.level = data[0].level
      self.email = data[0].email
      self.phone = data[0].phone
      self.money = data[0].money
    })
  }
}
</script>
